package com.dongdongshop.config;

import com.aliyun.dysmsapi20170525.Client;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliSmsClientConfig {

    @Bean
    public Client client(){
        Client client=null;
        try {
            com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
                    // 您的 AccessKey ID
                    .setAccessKeyId("LTAI4GCbdwnjCGwQj9Z3tr3N")
                    // 您的 AccessKey Secret
                    .setAccessKeySecret("27ih4pc1W1tqey9X4mmCy1JUotAX7L");
            // 访问的域名
            config.endpoint = "dysmsapi.aliyuncs.com";
            client=new Client(config);
            System.out.println("阿里大于配置类加载成功");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return client;
    }



}
